package top.glkj.hms;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import top.glkj.hms.dao.StatusSetDao;
import top.glkj.hms.entity.StatusSet;
import top.glkj.hms.utils.Status;

import java.util.HashSet;
import java.util.Set;

/**
 * @author : xgl
 * @version : 0.0.1
 * @date :2021/1/25 18:48
 */
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@RunWith(SpringRunner.class)
public class StatusInToSql {
    @Autowired
    private StatusSetDao setDao;
    @Test
    public void insertInto(){
        StatusSet set = new StatusSet();
        set.setId(2);
        set.setDescription("待入住");
        Set<Status> statuses = new HashSet<>();
        statuses.add(Status.ToStay);
        set.setStatuses(statuses);
        setDao.save(set);
    }
}
